package com.tensai.study.新概念.响应式编程.reactor.mono;

import reactor.core.publisher.Mono;

/**
 * @author Tensai
 */
public class FlatMap {

    public static void main(String[] args) {
        Mono<String> monoFlatMap = Mono.just("1").flatMap(a -> Mono.just(a + "1"));
        monoFlatMap.subscribe(System.out::println);
        System.out.println("------------");
        Mono<String> monoMap = Mono.just("2").map(a -> a + "2");
        monoMap.subscribe(System.out::println);

    }
}
